-- GENERATED SPELL FOR [Bloodwarder Legionnaire] --


function spell0_20031(pUnit, Event) --@Bloodthirst,n/a--
pUnit:FullCastSpellOnTarget(35949,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20031', 0, 1)
end

function spell1_20031(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(15284,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20031', 529, 1)
end

function spell2_20031(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(15578,pUnit)
pUnit:RegisterEvent('Sorts_20031', 598, 1)
end

function spell3_20031(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(33500,pUnit)
pUnit:RegisterEvent('Sorts_20031', 2000, 1)
end

function Sorts_20031(pUnit, Event)
local choix_sorts_20031 = math.random(0, 3)
if choix_sorts_20031 == 0 then
pUnit:RegisterEvent('spell0_20031', 1, 1)
end
if choix_sorts_20031 == 1 then
pUnit:RegisterEvent('spell1_20031', 1, 1)
end
if choix_sorts_20031 == 2 then
pUnit:RegisterEvent('spell2_20031', 1, 1)
end
if choix_sorts_20031 == 3 then
pUnit:RegisterEvent('spell3_20031', 1, 1)
end
end

function mob20031_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20031', math.random(1500, 3000), 1)
end

function mob20031_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20031_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20031_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20031, 1, 'mob20031_Action')
RegisterUnitEvent(20031, 2, 'mob20031_Leave')
RegisterUnitEvent(20031, 3, 'mob20031_Kill')
RegisterUnitEvent(20031, 4, 'mob20031_Die')
